const joi = require('joi')


//string值只能为字符串
//alphanum 只能为a-z 0-9
//min是最小长度 max为最大长度
//requrie是必填项

//账号进行验证
const account = joi.string().alphanum().min(6).max(12).required()

//密码进行验证 
const password = joi.string().pattern(/^(?![0-9]+$)[a-z0-9]{1,50}$/).min(6).max(12).required()

//暴露验证规则
exports.login_limit = {
    //body是request.body
    body: {
        account,
        password
    }
}